package io.renren.modules.gengyun.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.gengyun.dao.SoilConditionHourlyDao;
import io.renren.modules.gengyun.entity.SoilConditionHourlyEntity;
import io.renren.modules.gengyun.service.SoilConditionHourlyService;


@Service("soilConditionHourlyService")
public class SoilConditionHourlyServiceImpl extends ServiceImpl<SoilConditionHourlyDao, SoilConditionHourlyEntity> implements SoilConditionHourlyService {

    @Autowired
    SoilConditionHourlyDao soilConditionHourlyDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SoilConditionHourlyEntity> page = this.page(
                new Query<SoilConditionHourlyEntity>().getPage(params),
                new QueryWrapper<SoilConditionHourlyEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<Integer> getHumidityByCropRotationId(String cropsRotationPlotId, Long beginTime, Long endTime) {
        return null;
    }

    @Override
    public List<Integer> getTemperatureByCropRotationId(String cropsRotationPlotId, Long beginTime, Long endTime) {
        return null;
    }

    @Override
    public List<Map> getSoilLOT(String cropsRotationPlotId, String beginTime, String endTime) {
        return soilConditionHourlyDao.getSoilLOT(cropsRotationPlotId,beginTime,endTime);
    }

}